package protocol.funccode;

import protocol.funccode.registers.RegTblGenerator;
import protocol.funccode.registers.RegTblGeneratorException;

public class FcUtils {
	
	public static String genMODBUS_QUERY_CMD(String devid, String guid, String pdu, int prior) {
		String priorStr = Integer.toString(prior);
		return FcCommand.DEV_MODBUS_QUERY_CMD_STR+devid+guid+priorStr+pdu;
	}

	public static String genCharUnitCheckResult(String devid, String guid, int modCount) throws RegTblGeneratorException {
		RegTblGenerator gen = new RegTblGenerator();
		gen.appendUnsignedByte(modCount);
		return FcCommand.IB_CHAR_GET_SELF_CHECK+devid+guid+gen.toString();
	}
	
}
